<?php
include_once __ROOT__.'/class/DBHelper.class.php';
function hotNews ($from) {
    $db = new DBHelper();
    if ($from == 'tuvi') {
        $data = $db->execSQL("SELECT id, ages FROM t_tuvi", array(), false);
        if (count($data) > 0) {
            foreach ($data as $value) {
                echo '<tr class=""><td><a href= "#main" onclick="loadPage(\'tuvi\', '. $value['id'] .')"><span class="icon-thumbs-up"></span>&nbsp;&nbsp;'.$value['ages'].'</a></td></tr>';
            }
        }
    } else {
        $data = $db->execSQL("SELECT id, title FROM t_vova ORDER BY id DESC LIMIT 0,10", array(), false);
        if (count($data) > 0) {
            foreach ($data as $value) {
                echo '<tr class=""><td><a href= "#main" onclick="loadPage(\'vova\', '. $value['id'] .')"><span class="icon-thumbs-up"></span>&nbsp;&nbsp;'.$value['title'].'</a></td></tr>';
            }
        }
    }
}
?>